package net.pragyah.scalby



/*
 * Class that represents a variable 
 * 
 */

class Variable[A](val a:String,val values:Set[A],private val value:Option[A]) {

  private[Variable] var _value:Option[A] = value
  
  def apply(newValue:Option[A]){
    if(newValue == null) _value = None 
    assume(values.contains(newValue.get))
    _value = newValue
  }
  
  def apply():Option[A] = _value

  override def toString = a+" = "+ _value
  
  override def equals(that:Any) = that.isInstanceOf[Variable[A]] && that.asInstanceOf[Variable[A]].a.equals(a)
  
  
  
}
